/*
 * Block.h
 *
 *  Created on: 25/03/2013
 *      Author: Tulio
 */

#ifndef BLOCK_H_
#define BLOCK_H_

#include <iostream>
#include <vector>
#include <string>

#include "Parameter.h"

#define VALUE 0
#define TITLE 1


using namespace std;

#include "Parameter.h"
// The blocks is made by a cell.
// One cell can has a value or a title.
typedef struct {
  short int type;
  float value;
  std::string title;
  std::string function;
} Cell;

class Block {
public:
  Block();
  ~Block();
  void insertChild();
  void removeChild();
  // Getters methods.
  std::string getChildBlock(int i);
  std::string getFunction();
  Parameter getParameter();
  short int getType();
  std::string getTitle();
  float getValue();

  // Setters methods.
  void setChildBlocks(string child);
  void setFunction(std::string function);
  void setParameter(Block &a, float b);
  void setTitle(std::string title);
  void setType(int type);
  void setValue(float value);

private:
  std::vector<Parameter> parameter;//vetor de parametros da função
  std::vector<string> childBlocks; //blocos que são filhos deste bloco
  std::vector<string> parentBlocks;
  Cell cell;
};

#endif /* BLOCK_H_ */
